package com.neusoft.ecommerce.mapper;

import com.neusoft.ecommerce.dbhelper.LayuiPager;
import com.neusoft.ecommerce.dbhelper.Pager;
import com.neusoft.ecommerce.exception.EcommerceException;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 紫煦桉
 */
@Repository
public interface SuperMapper<T> {

    /**
     * findList 列表
     * @param pager
     * @return
     * @throws EcommerceException
     */
    List<T> findList(LayuiPager<T> pager) throws EcommerceException;

    /**
     * findAll
     * @return
     * @throws EcommerceException
     */
    List<T> findAll() throws EcommerceException;

    /**
     * findTotal 分页
     * @param pager
     * @return
     * @throws EcommerceException
     */
    int findTotal(LayuiPager<T> pager) throws EcommerceException;

    /**
     * add 添加数据
     * @param param
     * @return
     * @throws EcommerceException
     */
    Boolean add(T param) throws EcommerceException;

    /**
     * edit 更新修改数据
     * @param param
     * @return
     * @throws EcommerceException
     */
    Boolean edit(T param) throws EcommerceException;

    /**
     * delete 删除数据
     * @param param
     * @return
     * @throws EcommerceException
     */
    Boolean delete(T param) throws EcommerceException;
}
